Why am I getting this 'NoneType' object has no attribute 'current' AttributeError